home *** CD-ROM | disk | FTP | other *** search
- *** 1.29 1992/06/11 17:45:54
- --- Changelog 1992/07/21 14:55:32
- ***************
- *** 313,315 ****
- --- 313,322 ----
- corectly not demangle C and other unmangled symbols.
-
- ----------------------------- Patchlevel 29 ---------------------------------
- +
- + ar.c:: jean-marc jmz@obsbea.dnet.nasa.gov
- + diff for BYTE_SWAP (for gcc-ar cross on a little endian host, now
- + gcc-ar and gcc-ld are all set for cross work on a litle endian machine.
- + i suppose we should do rest of the utils too).
- +
- + ----------------------------- Patchlevel 30 ---------------------------------
- *** 1.27 1992/06/11 17:45:54
- --- PatchLev.h 1992/07/21 14:55:34
- ***************
- *** 1,4 ****
- ! #define PatchLevel "29"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,4 ----
- ! #define PatchLevel "30"
-
- /*
- * the Patch Level above is to identify the version
- *** 1.19 1991/09/24 17:30:39
- --- ar.c 1992/07/21 14:55:35
- ***************
- *** 92,97 ****
- --- 92,105 ----
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding! */
-
- + #ifdef BYTE_SWAP
- +
- + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
- + (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24))
- + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
- +
- + #endif /* BYTE_SWAP */
- +
- #ifdef CROSSATARI
- #ifdef USG
- #define bcopy(a,b,c) memcpy (b,a,c)
- ***************
- *** 1563,1568 ****
- --- 1571,1579 ----
- /* Write long containing number of symdefs. */
-
- symdefs_size = nsymdefs * sizeof (struct symdef);
- + #ifdef BYTE_SWAP
- + symdefs_size = SWAP4(symdefs_size);
- + #endif
- write (outdesc, &symdefs_size, sizeof symdefs_size);
-
- /* Write symdefs surviving from old archive. */
- ***************
- *** 1575,1580 ****
- --- 1586,1600 ----
- {
- if (mapptr->info.nsymdefs)
- {
- + #ifdef BYTE_SWAP
- + { register struct symdef *s = mapptr->info.symdefs;
- + register int i;
- + for(i = mapptr->info.nsymdefs; i; i--, s++) {
- + s->s.stringoffset = SWAP4(s->s.stringoffset);
- + s->offset = SWAP4(s->offset);
- + }
- + }
- + #endif
- write (outdesc, mapptr->info.symdefs,
- mapptr->info.nsymdefs * sizeof (struct symdef));
- }
- ***************
- *** 1582,1588 ****
- --- 1602,1614 ----
-
- /* Write long containing string table size. */
-
- + #ifdef BYTE_SWAP
- + new_strings_size = SWAP4(new_strings_size);
- + #endif
- write (outdesc, &new_strings_size, sizeof new_strings_size);
- + #ifdef BYTE_SWAP
- + new_strings_size = SWAP4(new_strings_size);
- + #endif
-
- /* Write string table */
-
- ***************
- *** 1660,1665 ****
- --- 1686,1701 ----
- }
-
- len = read (indesc, &header, sizeof header);
- + #ifdef BYTE_SWAP
- + header.a_info = SWAP4(header.a_info);
- + header.a_text = SWAP4(header.a_text);
- + header.a_data = SWAP4(header.a_data);
- + header.a_bss = SWAP4(header.a_bss);
- + header.a_syms = SWAP4(header.a_syms);
- + header.a_entry = SWAP4(header.a_entry);
- + header.a_trsize = SWAP4(header.a_trsize);
- + header.a_drsize = SWAP4(header.a_drsize);
- + #endif
- if (len != sizeof header)
- error_with_file ("failure reading header of ", mapelt);
- else if (N_BADMAG(header))
- ***************
- *** 1675,1681 ****
- close (indesc); /* We just opened it. Give up */
- return;
- }
- !
- /* number of symbol entries in the file */
- symcount = header.a_syms / sizeof (struct nlist);
-
- --- 1711,1719 ----
- close (indesc); /* We just opened it. Give up */
- return;
- }
- ! #ifdef BYTE_SWAP
- ! string_size = SWAP4(string_size);
- ! #endif
- /* number of symbol entries in the file */
- symcount = header.a_syms / sizeof (struct nlist);
-
- ***************
- *** 1697,1702 ****
- --- 1735,1749 ----
- if (indesc != archive_indesc)
- close (indesc);
-
- + #ifdef BYTE_SWAP
- + { register struct nlist *from = symbols_and_strings;
- + register struct nlist *end = symbols_and_strings + symcount;
- + for(;from < end; from++) {
- + from->n_un.n_strx = SWAP4(from->n_un.n_strx);
- + from->n_desc = SWAP2(from->n_desc);
- + }
- + }
- + #endif /* BYTE_SWAP */
- /* discard the symbols we don't want to mention; compact the rest down */
-
- symcount = filter_symbols (symbols_and_strings, symcount, strings);
- *** 1.5 1992/06/03 18:40:27
- --- fixstk.c 1992/07/21 14:55:36
- ***************
- *** 26,34 ****
- extern char *malloc();
- extern long lseek();
- #define size_t unsigned long
- #ifndef FILENAME_MAX
- # define FILENAME_MAX 128
- - #endif
- #endif
-
- #ifdef WORD_ALIGNED
- --- 26,35 ----
- extern char *malloc();
- extern long lseek();
- #define size_t unsigned long
- + #endif
- +
- #ifndef FILENAME_MAX
- # define FILENAME_MAX 128
- #endif
-
- #ifdef WORD_ALIGNED
- *** 1.5 1992/06/03 18:40:27
- --- printstk.c 1992/07/21 14:55:39
- ***************
- *** 21,29 ****
- extern char *malloc();
- extern long lseek();
- #define size_t unsigned long
- #ifndef FILENAME_MAX
- # define FILENAME_MAX 128
- - #endif
- #endif
-
- #ifdef WORD_ALIGNED
- --- 21,30 ----
- extern char *malloc();
- extern long lseek();
- #define size_t unsigned long
- + #endif
- +
- #ifndef FILENAME_MAX
- # define FILENAME_MAX 128
- #endif
-
- #ifdef WORD_ALIGNED
- *** 1.1 1989/06/12 23:27:26
- --- toglclr.c 1992/07/21 14:55:42
- ***************
- *** 12,17 ****
- --- 12,20 ----
- #include <string.h>
- #include <st-out.h>
-
- + #ifndef FILENAME_MAX
- + # define FILENAME_MAX 128
- + #endif
-
- int toggle (fd, fn)
- int fd;
-